The sequential benchmark was done in order to compare the response
time of REST and GraphQL. The test was done on two types of
sample.
The few sample contains :
- 10 users - 84 products - 79 orders
The lotof sample contains :
- 100’000 users - 84 products - 300204 orders
We simulate a user doing n requests where n = {1,10,100,1000,10000}
on three functions:
- getUsers (only user-microservice is involved).
- createProduct (only product-microservice is involved).
- userThatBoughtProduct (user, product and order microservices are
involved).
| category | func | type | 1 | 10 | 100 | 1000 | 10000 |
|---|---|---|---|---|---|---|---|
| few | createProduct | GraphQL | 50 | 50 | 50 | 50 | 50 |
| few | createProduct | REST | 50 | 50 | 50 | 50 | 50 |
| few | getUsers | GraphQL | 50 | 50 | 50 | 50 | 50 |
| few | getUsers | REST | 50 | 50 | 50 | 50 | 50 |
| few | userThatBoughtProduct | GraphQL | 50 | 50 | 50 | 50 | 0 |
| few | userThatBoughtProduct | REST | 50 | 50 | 50 | 50 | 0 |
| lot | createProduct | GraphQL | 50 | 50 | 50 | 50 | 50 |
| lot | createProduct | REST | 50 | 50 | 50 | 50 | 50 |
| lot | getUsers | GraphQL | 5 | 5 | 5 | 5 | 0 |
| lot | getUsers | REST | 5 | 5 | 5 | 5 | 0 |
| lot | userThatBoughtProduct | GraphQL | 5 | 5 | 0 | 0 | 0 |
| lot | userThatBoughtProduct | REST | 5 | 5 | 0 | 0 | 0 |
A concurrency benchmark was done with JMeter to test server performance and response time. The sample used is the few sample one. The test has not been done with the lotof sample because response times are too high.
| func | type | success | failure | success percent (%) |
|---|---|---|---|---|
| addProduct | graphql | 419973 | 3158109 | 11.74 |
| addProduct | rest | 432346 | 4175496 | 9.38 |
| getUsers | graphql | 429955 | 5713588 | 7.00 |
| getUsers | rest | 429939 | 5150337 | 7.70 |
| productBoughtByUser | graphql | 140286 | 12510546 | 1.11 |
| productBoughtByUser | rest | 178045 | 7617850 | 2.28 |